package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;
//model layer package has to be imported
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh, group 1(A)) 
 * @version (2005.03.31, 14-04-2011)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    //declaring instance variables
    private Collection myCollction;
    private DVD dvd;

    /**
     * Constructor for objects of class DVDCtr
     */
    public DVDCtr()
    {
        myCollction = myCollction.getInstance();
    }
    
    /**
     * Finds a DVD
     * @param id Id of the DVD to be found
     * @return Returns a DVD
     */
    public DVD findDVD(int id)
    {
       dvd = myCollction.findDvd(id);
       return dvd; 
    }
    
    //Dummy implementation: more parameters are probaly to added
    /**
     * Creates a DVD
     * @param id Id of DVD
     * @param title Title of the DVD
     * @param artist Artist of the DVD
     * @param releaseDate Release date of the DVD
     * @param serialNumber Serial number of the DVD
     * @param getDate Purchase date of the DVD
     * @param getPrice Purchase price of the DVD
     */
    public void createDVD(int id, String title, String artist, int relaseDate, int serialNumber, int getDate, int getPrice)
    {       
       DVD d = new DVD(id, title, artist, relaseDate, serialNumber, getDate, getPrice);
       myCollction.addDVD(d);
    }
    /** 
     * Deletes a DVD
     * @param id Id of the DVD
     */
    public void deleteDVD(int id)
    {
        //search for the dvd and delete the object from the container
       myCollction.deleteDVD(id);
    }
    
    /**
     * Create a description of the DVD
     * @param id Id of the DVD
     * @param description Description of the DVD
     */
    public void createDescription(int id, String description)
    {
        DVD dvd = findDVD(id);
        dvd.setDescription(description);
    }
    
    /**
     * Lists all DVD's
     */
    public void listAllDvds()
    {
           //returns a list of all dvds and their associated copies
           myCollction.listAllDVD();
    }
}
